package com.itsm.controller;

import com.itsm.entity.Control;
import com.itsm.service.mapper.ControlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 菜单权限
 */
@RestController
public class ControlController {


    @Autowired
    private ControlMapper controlMapper;

    /**
     * 菜单权限控制
     * @param request
     * @return
     */
    @GetMapping("getControl")
    public Control getControl(HttpServletRequest request){
        String staffNum = (String) request.getSession().getAttribute("alias");
        return controlMapper.getControl(staffNum);
    }


}
